<template>
  <a-card>
    <div>
      <a-space class="operator">
        <a-button @click="refresh" type="primary">刷新</a-button>
      </a-space>
      <standard-table
        :columns="columns"
        :dataSource="dataSource"
      >
        <template slot="statusTitle">
          <a-icon @click.native="onStatusTitleClick" type="info-circle" />
        </template>
      </standard-table>
    </div>
  </a-card>
</template>

<script>
import StandardTable from "@/components/table/StandardTable";
import { loadAll } from "@/services/hosiptal";
const columns = [
  {
    title: "ID",
    dataIndex: "id",
  },
  {
    title: "名称",
    dataIndex: "name",
  },
  {
    title: "位置",
    dataIndex: "position",
  },
  {
    title: "医生数",
    dataIndex: "workers",
  },
  {
    title: "病人数",
    dataIndex: "patients",
  },
  {
    title: "孕妇数",
    dataIndex: "pregnants",
  },
  {
    title: "修建时间",
    dataIndex: "buildingTime",
  },
  {
    title: "完工时间",
    dataIndex: "completeTime",
  }
];

const dataSource = [];

export default {
  name: "List",
  components: { StandardTable },
  data() {
    return {
      advanced: true,
      columns: columns,
      dataSource: dataSource,
    };
  },
  created() {
    this.refresh();
  },
  methods: {
    refresh() {
      loadAll().then((res) => (this.dataSource = res.data));
    },
  },
};
</script>

<style lang="less" scoped>
.search {
  margin-bottom: 54px;
}
.fold {
  width: calc(100% - 216px);
  display: inline-block;
}
.operator {
  margin-bottom: 18px;
}
@media screen and (max-width: 900px) {
  .fold {
    width: 100%;
  }
}
</style>
